package io.cloud.tec.project.enums;

import java.util.Objects;

public enum ResultEnum {

    SUCCESS_ZERO(0, "请求成功"),
    SUCCESS(200, "请求成功"),
    UNKNOWN(9999, "未知错误");

    public Integer code;
    public String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static Boolean isSuccessCode(Integer code) {
        return (!Objects.isNull(code)) && (SUCCESS.code.equals(code) || SUCCESS_ZERO.code.equals(code));
    }
}

